/*
 * AssetMessageListItem.java
 * business
 *
 * Created by ChenTao on 2017/1/9.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.AdapterView;

import com.yidiandao.business.manager.ImageManager;
import com.yidiandao.business.ui.adapter.AddPictureGridAdapter;
import com.yidiandao.business.ui.picturescan.PictureScanActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.OrderCertificateInfoHolder;

import java.util.List;

/**
 * 订单详情  凭证信息
 */
public class OrderCertificateInfoListItem extends DisplayListItem<OrderCertificateInfoHolder, List<String>> {

    public OrderCertificateInfoListItem(List<String> messageBean) {
        super(messageBean);
    }

    @Override
    public void onShow(final Context context, OrderCertificateInfoHolder holder) {
        ImageManager.getInstance().clearList();
        ImageManager.getInstance().setFinalImageList(data);
        AddPictureGridAdapter mAdapter = new AddPictureGridAdapter(context, data, false);
        holder.mGridView.setAdapter(mAdapter);
        holder.mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                PictureScanActivity.actionStart((Activity) context,position,false);
            }
        });
    }

    @Override
    public String getDisplayItemTag() {
        return OrderCertificateInfoListItem.class.getSimpleName();
    }

    @Override
    public Class<OrderCertificateInfoHolder> getViewHolderClazz() {
        return OrderCertificateInfoHolder.class;
    }
}
